Skip to content

fix(tenants): use nameEn for English locale on platform admin list#280

Open
abdout wants to merge 1 commit into
mainfrom
fix/261-tenant-name-i18n
Open

fix(tenants): use nameEn for English locale on platform admin list#280
abdout wants to merge 1 commit into
mainfrom
fix/261-tenant-name-i18n

Conversation

@abdout
Copy link
Copy Markdown
Contributor

@abdout abdout commented Apr 26, 2026

Summary

  • The /en/tenants page rendered the Arabic school name even when lang=en. The saas-dashboard tenants list went straight to getDisplayText without checking school.nameEn first, and when the Google Translate fallback failed silently, getDisplayText returned the source Arabic.
  • Mirror the canonical pattern from src/app/[lang]/s/[subdomain]/(school-dashboard)/layout.tsx:67-76: prefer pre-translated school.nameEn for English locale, fall through to on-demand translation only when nameEn is unset.
  • Bonus: removes a per-render translation API call for English viewers of already-translated school names (cost reduction).

Changes

  • src/components/saas-dashboard/tenants/content.tsx: add nameEn: true to the Prisma select; prefer nameEn for English locale before calling getDisplayText.

Test plan

  • On staging, visit /en/tenants as DEVELOPER → "King Fahad" (or equivalent nameEn) renders for tenants that have nameEn set.
  • On /ar/tenants, the Arabic name still renders (no regression).
  • For tenants without nameEn set, the existing getDisplayText translation path still runs.

Closes #261

The /en/tenants page rendered the Arabic school name even when lang=en
because the saas-dashboard tenants list went straight to getDisplayText
(on-demand translation) without checking school.nameEn first. When the
Google Translate fallback failed silently, getDisplayText returned the
source Arabic — surfacing as the bug reported in #261.

Mirror the canonical pattern from (school-dashboard)/layout.tsx:67-76:
prefer the pre-translated school.nameEn for English display, and only
fall through to on-demand translation when nameEn is unset. This also
removes the per-render translation API call for English viewers of
already-translated school names.

Closes #261

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hogwarts Ready Ready Preview, Comment Apr 26, 2026 11:17am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

king fahad name is show in ar eventhough app lang is en

1 participant